<template>
  <div class="box">
    <!-- <aliUpload
    ></aliUpload> -->
  </div>
</template>

<script>
import { postInterCode } from "../assets/js/api";
// import aliUpload from "../components/upload.vue";
export default {
  // components: {
  //   aliUpload
  // },
  data() {
    return {
      id: null,
      uploadUrl: [],
      uploadId: "file",
      uploadCode: 0
    };
  },
  created() {
    let obj = this.$route.query;
    let id = Number(obj.id);
    this.id = obj.id;
    this.postInterCode(id);
  },
  methods: {
    postInterCode(id) {
      sessionStorage.setItem("userId", id);
      postInterCode(id)
        .then(res => {
          if (res.code == 200) {
            sessionStorage.setItem("code", res.data);
            this.$router.push({
              path: "/sign/index/basic"
            });
          } else {
            this.$router.push({
              path: "/sign/index/404"
            });
          }
        })
        .catch(() => {
          this.$router.push({
            path: "/sign/index/timeOut"
          });
        });
    }
  }
};
</script>

<style scoped lang="less">
.box {
  width: 100%;
  height: 100vh;
}
</style>
